% This file creates Figure C1, C2, C3, and C4, presented in Appendix C. In
% order to create those, it runs either file 'FIG_C1_main.m' or file
% 'FIGs_C2_C3_C4_growth_main.m.'

clc; close all; clear;

%% Transitory Case. Figure C1. 

run FIG_C1_main.m;

t           =   0:20;
figure; 
subplot(2,2,1)
plot(t,irf2(p_y,1:long-1),'-b',t,irf_ss(p_y,1:long-1),'--b','Linewidth',1.5)
grid on
title('$Y$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
subplot(2,2,2)
plot(t,irf2(p_int,1:long-1),'-b',t,irf_ss(p_int,1:long-1),'--b','Linewidth',1.5)
grid on
title('$i$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
subplot(2,2,3)
plot(t,irf2(p_infl,2:long),'-b',t,irf_ss(p_infl,2:long),'--b','Linewidth',1.5)
grid on
title('$\pi_{t+1}^{e}$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
subplot(2,2,4)
plot(t,r_irf2(1:long-1),'-b',t,r_irf_ss(1:long-1),'--b','Linewidth',1.5)
grid on
title('$r$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
legend('Outside ZLB','At ZLB','Location','NorthEast')

%% Permanent Case. Figures C2, C3, and C4. 

global rhoA    

rhoAs       =   [0, 0.1, 0.4];              % For different persistence values.

for ix = 1:length(rhoAs)
    
    rhoA        =   rhoAs(ix);

run FIGs_C2_C3_C4_growth_main.m;

t           =   0:20;
figure;
subplot(2,2,1)
plot(t,cumsum(irf2(p_dy,1:long-1)),'-b',t,cumsum(irf_ss(p_dy,1:long-1)),'--b','Linewidth',1.5)
grid on
title('$Y$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
subplot(2,2,2)
plot(t,irf2(p_int,1:long-1),'-b',t,irf_ss(p_int,1:long-1),'--b','Linewidth',1.5)
grid on
title('$i$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
subplot(2,2,3)
plot(t,irf2(p_infl,2:long),'-b',t,irf_ss(p_infl,2:long),'--b','Linewidth',1.5)
grid on
title('$\pi_{t+1}^{e}$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
subplot(2,2,4)
plot(t,r_irf2(1:long-1),'-b',t,r_irf_ss(1:long-1),'--b','Linewidth',1.5)
grid on
title('$r$','Interpreter','latex','fontSize',12)
xlabel('Horizon','Interpreter','latex','fontSize',12)
legend('Outside ZLB','At ZLB','Location','NorthEast')
end
